import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmDocumentReceiveVO, AdmDocumentReceiveForm, AdmDocumentReceiveQuery } from '@/api/general/administration/document/receive/types';

/**
 * 查询收文审批列表
 * @param query
 * @returns {*}
 */

export const listAdmDocumentReceive = (query?: AdmDocumentReceiveQuery): AxiosPromise<AdmDocumentReceiveVO[]> => {
  return request({
    url: '/system/admDocumentReceive/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询收文审批详细
 * @param id
 */
export const getAdmDocumentReceive = (id: string | number): AxiosPromise<AdmDocumentReceiveVO> => {
  return request({
    url: '/system/admDocumentReceive/' + id,
    method: 'get'
  });
};

/**
 * 新增收文审批
 * @param data
 */
export const addAdmDocumentReceive = (data: AdmDocumentReceiveForm) => {
  return request({
    url: '/system/admDocumentReceive',
    method: 'post',
    data: data
  });
};

/**
 * 修改收文审批
 * @param data
 */
export const updateAdmDocumentReceive = (data: AdmDocumentReceiveForm) => {
  return request({
    url: '/system/admDocumentReceive',
    method: 'put',
    data: data
  });
};

/**
 * 删除收文审批
 * @param id
 */
export const delAdmDocumentReceive = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admDocumentReceive/' + id,
    method: 'delete'
  });
};
